<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('遗失报废列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <input type="text"  name="searchParam" placeholder="序号/编号/资产编码/名称/型号"/>
                            </li>
                            <!--<li>-->
                                <!--<input type="text" name="inventoryId" placeholder="盘点编号"/>-->
                            <!--</li>-->
                            <li>
                                <p>类别：</p>
                                <select name="status" class="form-control" th:with="type=${@dict.getType('lost_scrap_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:scrap:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "inventory/scrap";

        $(function() {
            var options = {
                url: prefix + "/list",
                exportUrl: prefix + "/export",
                modalName: "遗失报废",
                sortName: "createTime",
                sortOrder: "desc",
                columns: [
                {
                    field : 'inventoryNo', 
                    title : '资产序号'
                },
                // {
                //     field : 'inventoryId',
                //     title : '盘点编号'
                // },
                {
                    field : 'assetNo',
                    title : '卡片编号'
                },
                {
                    field : 'assetCode',
                    title : '资产编号',
                },
                {
                    field : 'assetName',
                    title : '资产名称'
                },
                {
                    field : 'specifications',
                    title : '规格'
                },
                {
                    field : 'assetModel',
                    title : '型号'
                },
                    {
                        field : 'manageDeptName',
                        title : '管理部门',
                    },
                    {
                        field : 'useDeptName',
                        title : '使用部门'
                    },
                    {
                        field : 'address',
                        title : '使用地点'
                    },
                {
                    title : '类别',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push($.table.selectDictLabel([[${@dict.getType('lost_scrap_type')}]], row.status));
                        return actions.join('');
                    },
                },
                {
                    field : 'createByName',
                    title : '创建人'
                },
                {
                    field : 'createTime',
                    title : '创建时间',
                    sortable:true
                },
                {
                    field : 'remark', 
                    title : '备注'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>